<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2017/9/19
  Time: 10:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Title</title>
    <link href="css/main.css" rel="stylesheet">
    <jsp:include page="cssAndjs.jsp"/>
    <style>

        .center {
            text-align: center;
        }

        .cell {
            margin-top: 10px;
            display: block;
        }

        .tip {
            color: red;
        }
        .carousel img{
            width: 100%;
            /*height: 300px !important;*/
        }
        .top{
            margin-top: 5%;
        }
    </style>
</head>
<body>

<%
    String baseUrl = request.getContextPath();
%>
<div class="container text-center">
    <div class="row top clearfix">

        <div class="col-md-6 column">
            <div class="carousel slide" id="carousel-76645">
                <ol class="carousel-indicators">
                    <li class="active" data-slide-to="0" data-target="#carousel-76645">
                    </li>
                    <li data-slide-to="1" data-target="#carousel-76645">
                    </li>
                    <li data-slide-to="2" data-target="#carousel-76645">
                    </li>
                </ol>
                <div class="carousel-inner">
                    <div class="item active">
                        <img alt="" src="img/resultcar.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                First Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                    <div class="item">
                        <img alt="" src="img/scancar.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                Second Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                    <div class="item">
                        <img alt="" src="img/showcar.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                Third Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                </div> <a class="left carousel-control" href="#carousel-76645" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a> <a class="right carousel-control" href="#carousel-76645" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
            </div>
        </div>

        <div class="col-md-6 column">
            <h2>在线商城用户登录</h2>
            <h5 class="text-danger">
                <%
                    String msg = (String) request.getAttribute("msg");
                    if (msg == null) {

                    } else {
                %>
                **<%=msg%>

                <%
                    }
                %>
            </h5>

            <form role="form" method="post" action="<%=baseUrl%>/uncheck/user/login" id="login">
                <div class="form-group row">
                    <label class="col-sm-2 col-xs-4 control-label">用户名:</label>
                    <div class="col-sm-10 col-xs-8">
                        <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名"/>
                    </div>
                </div>

                <div class="form-group row">
                    <label class="col-sm-2 col-xs-4 control-label">密&nbsp;&nbsp;&nbsp;码:</label>
                    <div class="col-sm-10 col-xs-8">
                        <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码"/>
                    </div>
                </div>

                <div class="form-group row">
                    <button type="button" class="btn btn-default" onclick="sub();">登录</button>
                    <button type="reset" class="btn btn-default">重置</button>
                </div>

                <div class="form-group row">
                    <a href="<%=baseUrl%>/reg.jsp">注册</a>
                </div>

            </form>
        </div>
    </div>
</div>

</body>
</html>
<script>
    function sub() {
        var username = $("#username").val();
        var pass = $("#password").val();
        if (!username) {
            alert("用户名不能为空")
            return;
        }

        if (!pass) {
            alert("密码不能为空")
            return;
        }

        $("#login").submit();
    }
</script>
